You might be wondering why CloudFormation is special, I hope by the time you finish reading this article, you will understand and perhaps agree that it is indeed.
I’ve always been amazed by the capabilities of CloudFormation; and have always wanted to use it for an enterprise scale design and deployment.
On one of my previous projects as a Cloud Solutions Architect, I had a scoping meeting with the CTO at the client organisation and I remember him saying “We have sister companies around the world and whatever cloud solution you design and implement we’ll replicate it across our sister companies” I said to myself, “this is it, this is the opportunity for my solution to shine with CloudFormation”, so I replied the CTO, “say no more, we will be using AWS and I know a service that will transform your business.”
What exactly is AWS CloudFormation?
AWS CloudFormation is a service provided by Amazon Web Services that allow you to create a collection of AWS services with a text file template. You can use this template to define all the resources that make up your stack, then working within the template, you can make changes, update and delete a stack as a single unit. Templates also allow you to easily deploy your solution repeatedly and consistently, limiting deployment stalls and defects.
When you use CloudFormation, you don’t have to worry about the sequence of your deployment, everything is handled by CloudFormation. For example, if you would like to create a private subnet, normally you’d have to create the VPC first, with CloudFormation all this is managed for you. CloudFormation’s intelligence means it knows the deployment sequence of the services that make up your stacks. CloudFormation is an infrastructure as a code service and it supports JSON and YAML.
Top 3 features that made CloudFormation essential to my project’s success
- Change Set – I led a team of incredibly talented Project Managers and Cloud Engineers, during the early stages of deployment, intensive performance testing was done, which led to some changes within the stack - for example resizing the EC2 and modifying the configuration of Route tables. Based on my experience, it is typically very time consuming to implement these changes and often the changes affect other resources within the stack. With Change Set, we were able to modify our template and preview how the proposed changes to the template might affect other running resources within the stack. CloudFormation is so intelligent that it analysed the existing stack against the changes we made to the template, and implemented only the changes we made, with no need to tear down the whole stack.
- Roll back – Sometimes as Cloud Architects or Engineers, we can deploy a solution then realize a defect during deployment, which can mean deleting services we’ve already deployed and sometimes, starting all over again. Even deleting is not as easy as it sounds, most resources are dependent and tied to each other, so you might have to delete the independent resources first, then delete the dependent resources, we all know how excruciating that can be! In my project CloudFormation alleviated these challenges. Because we deployed with CloudFormation every time a stack deployment failed, CloudFormation rolled back all the deployments by deleting the resources created automatically.
- Nested Stack - As the project progressed and the infrastructure expanded, scenarios came up where we could use the same components in several of our templates. So instead of writing configurations every time, we could a separate template for a service and reference it in other templates. For example, we had an Autoscaling launch configuration that we regularly used, instead of writing the configuration every time within our templates, with CloudFormation we were able to create an independent template for the Autoscaling launch configuration and reference it in other templates.
Using CloudFormation for this project costed us nothing, it’s completely free!
The only costs involved were for the resources we provisioned using CloudFormation, for example the EC2, RDS, S3 we deployed with CloudFormation.
This complex enterprise project, and many other businesses around the world continue to leverage this versatile service from CloudFormation. It saved costs, time, operational effort, improved deployment stability and reduced deployment defects.